package game;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import player.AIPlayer;
import player.Player;

public abstract class GameController {
    protected static List<Player> players = new LinkedList<Player>();

    public static Collection<Player> getAllPlayers() {
        return players;
    }
    public static Collection<AIPlayer> getAIPlayers() {
        List<AIPlayer> aiPlayers = new LinkedList<AIPlayer>();
        for(Player player : players) {
            if(player instanceof AIPlayer)
                aiPlayers.add((AIPlayer)player);
        }
        return aiPlayers;
    }
    public static void registerPlayer(Player player) {
        players.add(player);
    }
    public static void removePlayer(Player player) {
        players.remove(player);
    }
}
